package cn.intotw.rdcj.flash.controller;


import cn.intotw.rdcj.core.bean.DataResponse;
import cn.intotw.rdcj.core.constant.Constants;
import cn.intotw.rdcj.flash.api.RdcjFlashApi;
import cn.intotw.rdcj.flash.bean.OrderCreateReqVo;
import cn.intotw.rdcj.flash.service.impl.FlashServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.validation.Valid;

/**
 * @author Chenxiang
 * @Description: 下单接口类
 * @create 2020/4/9 11:02
 * @see RdcjFlashApi
 */
@RestController
@RequestMapping("/rdcj/flash")
@Api(value = "/rdcj/flash", tags = {"flashTag"})
@Slf4j
public class FlashApiController {
    @Autowired
    FlashServiceImpl flashService;
    @ApiOperation(value = "Api-下单接口", notes = "Api-下单接口")
    @PostMapping("/v1/createOrder")
    public ModelAndView createOrder(@RequestBody @Valid @ApiParam(name = "订单信息", value = "传入json格式",
            required = true) OrderCreateReqVo orderCreateReqVo) {
        log.info("hello--------------------------------------------");
        return new ModelAndView(Constants.JSON_DATA_VIEW, DataResponse.successWithResult(orderCreateReqVo));
    }
}